﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>培训类型设置-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../static/css/font.css">
    <link rel="stylesheet" href="../../static/css/weadmin.css">
    <link rel="stylesheet" href="../../lib/layui/css/layui.css" media="all">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <div class="weadmin-nav">
        <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">培训管理</a>
            <a>
                <cite>培训类型管理</cite>
            </a>
        </span>
        <a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">&#x1002;</i>
        </a>
    </div>
    <div id="testText">
        zheli是文字AAAA
    </div>
    <div class="weadmin-body">
        <div class="layui-row">
            <form class="layui-form layui-col-md12 we-search">
                类型编号：
                <div class="layui-inline">
                    <input type="text" name="username" placeholder="类型名称" autocomplete="off" class="layui-input">
                </div>
                类型名称
                <div class="layui-inline">
                    <input type="text" name="username" placeholder="类型名称" autocomplete="off" class="layui-input">
                </div>
                <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            </form>
        </div>
        <div class="weadmin-block">
            <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>
            <button class="layui-btn" onclick="WeAdminShow('添加类型','./traintypeadd.html',600,400)"><i class="layui-icon"></i>添加</button>
            <span class="fr" style="line-height:40px">共有数据：88 条</span>
        </div>
        <table class="layui-table" id="memberList">
            <thead>
                <tr>
                    <th>
                        <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
                    </th>
                    <th>ID</th>
                    <th>用户名</th>
                    <th>性别</th>
                    <th>手机</th>
                    <th>邮箱</th>
                    <th>地址</th>
                    <th>加入时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr data-id="1">
                    <td>
                        <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id="1"><i class="layui-icon">&#xe605;</i></div>
                    </td>
                    <td>1</td>
                    <td>小张</td>
                    <td>男</td>
                    <td>17600000000</td>
                    <td>admin@mail.com</td>
                    <td>北京市 海淀区</td>
                    <td>2017-01-01 11:11:42</td>
                    <td class="td-status">
                        <span class="layui-btn layui-btn-normal layui-btn-xs">已启用</span>
                    </td>
                    <td class="td-manage">
                        <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用">
                            <i class="layui-icon">&#xe601;</i>
                        </a>
                        <a title="编辑" onclick="WeAdminEdit('编辑','./edit.html', 1, 600, 400)" href="javascript:;">
                            <i class="layui-icon">&#xe642;</i>
                        </a>
                        <a onclick="WeAdminShow('修改密码','./password.html',600,400)" title="修改密码" href="javascript:;">
                            <i class="layui-icon">&#xe631;</i>
                        </a>
                        <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                            <i class="layui-icon">&#xe640;</i>
                        </a>
                    </td>
                </tr>
                <tr data-id="2">
                    <td>
                        <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
                    </td>
                    <td>2</td>
                    <td>小明</td>
                    <td>女</td>
                    <td>13000000000</td>
                    <td>admin@mail.com</td>
                    <td>北京市 海淀区</td>
                    <td>2017-01-01 11:11:42</td>
                    <td class="td-status">
                        <span class="layui-btn layui-btn-normal layui-btn-xs">已启用</span>
                    </td>
                    <td class="td-manage">
                        <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用">
                            <i class="layui-icon">&#xe601;</i>
                        </a>
                        <a title="编辑" onclick="WeAdminEdit('编辑','./edit.html', 2, 600, 400)" href="javascript:;">
                            <i class="layui-icon">&#xe642;</i>
                        </a>
                        <a onclick="WeAdminShow('修改密码','./password.html',600,400)" title="修改密码" href="javascript:;">
                            <i class="layui-icon">&#xe631;</i>
                        </a>
                        <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                            <i class="layui-icon">&#xe640;</i>
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="page">
            <div>
                <a class="prev" href="">&lt;&lt;</a>
                <a class="num" href="">1</a>
                <span class="current">2</span>
                <a class="num" href="">3</a>
                <a class="num" href="">489</a>
                <a class="next" href="">&gt;&gt;</a>
            </div>
        </div>
    </div>
    <!--<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>-->
    <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    <script src="../../static/js/eleDel.js" type="text/javascript" charset="utf-8"></script>

    <table id="demo" lay-filter="test"></table>
    <div id="demo7"></div>

    <div id="pTable" style="width: 1200px;">
        <table class="layui-table" id="layui_table_id" lay-filter="test"></table>
        <div id="laypage"></div>
    </div>
    <div id="test1"></div>


</body>

</html>


<script>
    layui.use('table', function () {
        var table = layui.table;
        table.render({
            elem: '#demo',
            height: 500,
            url: ApiUrl + 'TrainType/Search',
            where: { swhere: "", startindex: 1, endindex: 30 },
            method:'GET',
            cols: [[
                { field: 'TTID', title: 'ID', width: 80, sort: true, fixed: 'left' },
                { field: 'TTName', title: '类型名称', width: 100  },
                { field: 'TTDescribe', title: '类型描述', width: 200 }
            ]],
            response: {
                statusName: 'StatusCode',
                statusCode: 200,
                countName:'Count',
                msgName: 'Info', 
                dataName: 'Data'
            },
            page: true
            ,limit:10
        });


        var laypage = layui.laypage;

        //执行一个laypage实例
        laypage.render({
            elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
            , count: 50 //数据总数，从服务端得到
            , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
        });

        ////完整功能
        //laypage.render({
        //    elem: 'demo7'
        //    , count: 100
        //    , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
        //    , jump: function (obj) {
        //        console.log(obj)
        //    }
        //});



        //var limitcount = 10;
        //var curnum = 1;
        ////列表查询方法
        //function productsearch(start, limitsize) {
        //    layui.use(['table', 'laypage', 'laydate'], function () {
        //        var table = layui.table,
        //            laydate = layui.laydate,
        //            laypage = layui.laypage;
        //        table.render({
        //            elem: '#layui_table_id'
        //            , url: ApiUrl + 'TrainType/Search',
        //            where: { swhere: "", startindex: start, endindex: 30 }
        //            /*, where:{pagename:start,pagelimit:limitsize} //传参*/
        //            ,
        //            cols: [[
        //                { field: 'TTID', title: 'ID', width: 80, sort: true, fixed: 'left' },
        //                { field: 'TTName', title: '类型名称', width: 100 },
        //                { field: 'TTDescribe', title: '类型描述', width: 200 }
        //            ]],
        //            response: {
        //                statusName: 'StatusCode',
        //                statusCode: 200,
        //                countName: 'Count',
        //                msgName: 'Info',
        //                dataName: 'Data'
        //            }
        //            , page: false
        //            , height: 430
        //            , done: function (res, curr, count) {
        //                //如果是异步请求数据方式，res即为你接口返回的信息。
        //                //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
        //                laypage.render({
        //                    elem: 'laypage'
        //                    , count: count
        //                    , curr: curnum
        //                    , limit: limitcount
        //                    , layout: ['prev', 'page', 'next', 'skip', 'count', 'limit']
        //                    , jump: function (obj, first) {
        //                        if (!first) {
        //                            curnum = obj.curr;
        //                            limitcount = obj.limit;
        //                            //console.log("curnum"+curnum);
        //                            //console.log("limitcount"+limitcount);
        //                            //layer.msg(curnum+"-"+limitcount);
        //                            productsearch(productGroupId, curnum, limitcount);
        //                        }
        //                    }
        //                })
        //            }
        //        });

        //        //监听工具条
        //        table.on('tool(test)', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
        //            var data = obj.data //获得当前行数据
        //                , layEvent = obj.event; //获得 lay-event 对应的值
        //            if (layEvent === 'detail') {
        //                viewLableInfo(data.attrId);
        //                layer.msg(data.attrId);
        //            } else if (layEvent === 'del') {
        //                layer.msg('删除');
        //            } else if (layEvent === 'edit') {
        //                layer.msg('编辑操作');
        //            }
        //        });
        //        //常规用法
        //        laydate.render({
        //            elem: '#createDate'
        //        });
        //        //常规用法
        //        laydate.render({
        //            elem: '#processingTime'
        //        });

        //    });
        //}
        //var pId = '${pGBean.pgId }';
        //productsearch(pId, curnum, limitcount);



















    });
</script>